package gui.arp;

import java.awt.Color;
import java.awt.Component;
import java.awt.Font;

import javax.swing.JLabel;
import javax.swing.JTable;
import javax.swing.table.TableCellRenderer;

@SuppressWarnings("serial")
public class ArpCellRenderer extends JLabel implements TableCellRenderer {
		
	public ArpCellRenderer(Color fgColor, Font font) {
		super();
		this.setForeground(fgColor);
		this.setFont(font);
		this.setHorizontalAlignment(CENTER);
		
		//String[] fonts = GraphicsEnvironment.getLocalGraphicsEnvironment().getAvailableFontFamilyNames();
		//for (String s: fonts) System.out.println(s);
	}
	
	@Override
	public Component getTableCellRendererComponent(JTable table, Object value, boolean isSelected, 
			boolean hasFocus, int row, int column)  {
		this.setText((String) table.getModel().getValueAt(row, column));
		if (column == 1 && row == 1) System.out.println("getTableCellRendererComponent()");
		if (column != 0) this.setSize(44, 44);
		if (isSelected) {
			System.out.println("Selected: " + row + "," + column + " editable: " + table.isCellEditable(row, column));
		}
		return this;
	}
}
